class TFECSphere extends TournamentPickUp;

var xemitter fx;

replication
{
    reliable if( Role==ROLE_Authority )
	fx;
}

simulated function PreBeginPlay()
{
}

simulated function Destroyed()
{
    if(fx!=none) fx.destroy();

    super.Destroyed();
}

static function string GetLocalString(
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2
	)
{
	return Default.PickupMessage;
}

auto state Pickup
{
	simulated function BeginState()
	{
//		if(effectisrelevant(location,true))
//        {
            fx=spawn(class'TaskForces.TFECSphereFX',self);
//	    }
	}

    function Touch( actor Other )
	{
		if ( ValidTouch(Other) )
		{
            if(tfpri(Pawn(Other).playerreplicationinfo)!=none)
            {
			    tfpri(Pawn(Other).playerreplicationinfo).addRes(50);
                AnnouncePickup(Pawn(Other));
                Destroy();
            }
		}
	}
}

defaultproperties
{
     MaxDesireability=0.700000
     PickupMessage="You picked up a EnergySphere +50"
     PickupSound=Sound'TFMedia.Buildings.TFPickEC'
     PickupForce="HealthPack"
     DrawType=DT_None
     Physics=PHYS_Rotating
     CollisionRadius=10.000000
     CollisionHeight=10.000000
     bProjTarget=True
     Mass=10.000000
}
